<!DOCTYPE html>
<html lang="pt-BR">
    <head>
        <?php
        session_start();
        include_once'bloco/head.php';
        include_once '../control/conexao.php';
        include_once '../control/valida_sessao.php';

        function __autoload($classe) {
            include_once"../model/{$classe}.class.php";
        }
        ?>
        <link href="bootstrap/css/morris.css" rel="stylesheet">
    </head>
    <body>      
        <div id="wrapper">
            <?php include_once'bloco/navbar.php';
            include_once '../control/valida_perfil.php';
            ?>
            <div id="page-wrapper">
                <?php include_once 'bloco/banner.php';?>                  
                <div class="row">
                    <div class=" panel panel-success">
                        <div class="panel-heading">
                            <p class="panel-title"><i class = "glyphicon glyphicon-th-large"></i> Consultar Funcionario</p>
                        </div>
                        <div class="panel-body">
                            <div class="col-md-6 col-md-offset-3">
                                <div class="alert alert-success alert-dismissable">
                                    <table class="table table-condensed table-responsive">
                                        <?php
                                        $funcionario = new usuario();
                                        $funcionario->id_usuario = $_GET['id'];
                                        $usuarioDAO = new usuarioDAO();
                                        $funcionario = $usuarioDAO->consultar($funcionario);
                                        ?>
                                        <tr>
                                            <td><strong>Nome</strong></td>
                                            <td><?php echo utf8_encode($funcionario->usuario_nick) ?></td>
                                        </tr>
                                        <tr>
                                            <td><strong>Login</strong></td>
                                            <td><?php echo utf8_encode($funcionario->usuario_login) ?></td>                                        
                                        </tr>
                                        <?php
                                        $consulta_perfil = mysql_query("SELECT * FROM perfil WHERE id_perfil='$funcionario->id_perfil'");
                                        $perfil = mysql_result($consulta_perfil, 0, 'perfil_nome');
                                        ?>
                                        <tr>
                                            <td><strong>Perfil</strong></td>
                                            <td><?php echo utf8_encode($perfil) ?></td>                                        
                                        </tr>                                                            
                                    </table>
                                    <?php ?>
                                    <div align="center">
                                        <input type="button" class="btn btn-inverse" value="Voltar" onclick="history.go(-1)"/>
                                        <a href="editar_funcionario.php?id=<?php echo $funcionario->id_usuario ?>"><input type="button" class="btn btn-success" value="Alterar" /></a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <?php
        include_once'bloco/scripts.php';
        ?>
    </body>
</html>